load("//bazel:macros.bzl", "exports_files_legacy", "skia_cc_deps", "split_srcs_and_hdrs")

licenses(["notice"])

exports_files_legacy()

VK_FILES = [
    "GrVkAMDMemoryAllocator.cpp",
    "GrVkAMDMemoryAllocator.h",
    "GrVkBuffer.cpp",
    "GrVkBuffer.h",
    "GrVkCaps.cpp",
    "GrVkCaps.h",
    "GrVkCommandBuffer.cpp",
    "GrVkCommandBuffer.h",
    "GrVkCommandPool.cpp",
    "GrVkCommandPool.h",
    "GrVkDescriptorPool.cpp",
    "GrVkDescriptorPool.h",
    "GrVkDescriptorSet.cpp",
    "GrVkDescriptorSet.h",
    "GrVkDescriptorSetManager.cpp",
    "GrVkDescriptorSetManager.h",
    "GrVkExtensions.cpp",
    "GrVkFramebuffer.cpp",
    "GrVkFramebuffer.h",
    "GrVkGpu.cpp",
    "GrVkGpu.h",
    "GrVkImage.cpp",
    "GrVkImage.h",
    "GrVkImageLayout.h",
    "GrVkImageView.cpp",
    "GrVkImageView.h",
    "GrVkInterface.cpp",
    "GrVkInterface.h",
    "GrVkMSAALoadManager.cpp",
    "GrVkMSAALoadManager.h",
    "GrVkManagedResource.h",
    "GrVkMemory.cpp",
    "GrVkMemory.h",
    "GrVkOpsRenderPass.cpp",
    "GrVkOpsRenderPass.h",
    "GrVkPipeline.cpp",
    "GrVkPipeline.h",
    "GrVkPipelineState.cpp",
    "GrVkPipelineState.h",
    "GrVkPipelineStateBuilder.cpp",
    "GrVkPipelineStateBuilder.h",
    "GrVkPipelineStateCache.cpp",
    "GrVkPipelineStateDataManager.cpp",
    "GrVkPipelineStateDataManager.h",
    "GrVkRenderPass.cpp",
    "GrVkRenderPass.h",
    "GrVkRenderTarget.cpp",
    "GrVkRenderTarget.h",
    "GrVkResourceProvider.cpp",
    "GrVkResourceProvider.h",
    "GrVkSampler.cpp",
    "GrVkSampler.h",
    "GrVkSamplerYcbcrConversion.cpp",
    "GrVkSamplerYcbcrConversion.h",
    "GrVkSecondaryCBDrawContext.cpp",
    "GrVkSecondaryCBDrawContext_impl.h",
    "GrVkSemaphore.cpp",
    "GrVkSemaphore.h",
    "GrVkTexture.cpp",
    "GrVkTexture.h",
    "GrVkTextureRenderTarget.cpp",
    "GrVkTextureRenderTarget.h",
    "GrVkTypesPriv.cpp",
    "GrVkUniformHandler.cpp",
    "GrVkUniformHandler.h",
    "GrVkUtil.cpp",
    "GrVkUtil.h",
    "GrVkVaryingHandler.cpp",
    "GrVkVaryingHandler.h",
]

split_srcs_and_hdrs(
    name = "vk",
    files = VK_FILES,
)

filegroup(
    name = "srcs",
    srcs = [":vk_srcs"],
    visibility = ["//src/gpu/ganesh:__pkg__"],
)

filegroup(
    name = "private_hdrs",
    srcs = [":vk_hdrs"],
    visibility = ["//src/gpu/ganesh:__pkg__"],
)

skia_cc_deps(
    name = "deps",
    visibility = ["//src/gpu/ganesh:__pkg__"],
    deps = select({
        "//src/gpu:vulkan_with_vma": ["//third_party/vulkanmemoryallocator"],
        "//conditions:default": [],
    }),
)
